package io.dy.stream;

import java.util.*;
import java.util.stream.Collectors;

/**
 * @author : dmj
 * @date: 2024/12/17 4:46 下午
 * @description:
 */
public class Main {

    public static void main(String[] args) {
        List<Integer> list = Arrays.asList(1,2,3,4,3,5);

//        DyStream.of(list)
//                .filter(o-> o%2 == 0)
//                .map(o-> o * o)
//                .foreach(System.out::println);

        //System.out.println(DyStream.of(list).reduce(Integer.MAX_VALUE, Integer::min));

//        StringBuilder collect = DyStream.of(list).collect(StringBuilder::new, StringBuilder::append);
//        System.out.println(collect);

        HashSet<Integer> collect = list.stream().collect(HashSet::new, HashSet::add, AbstractCollection::addAll);
        System.out.println(collect);
    }
}
